<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAdDataTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('ad_data', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title',120)->comment('标题');
            $table->unsignedBigInteger('space_id',false)->default(0)->index()->comment('广告位id');
            $table->string('file',160)->nullable()->comment('附件地址');
            $table->string('url',160)->nullable()->comment('跳转链接');
            $table->unsignedInteger('listorder',false)->nullable()->default(0)->comment('排序');
            $table->unsignedTinyInteger('status',false)->default(0)->comment('状态');
            $table->timestamps();
            $table->softDeletes();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('ad_data');
    }
}
